
# 变量持久化练习
import pickle

# 将变量写入到 pkl 文件中
def writeVar(Path,a):
    f = open(Path, 'wb')
    pickle.dump(a, f)
    f.close()

# 从 pkl 文件中读取变脸
def readVar(Path):
    f = open(Path, 'rb')
    test = pickle.load(f)
    f.close()
    return test

# if __name__=='__main__':
#     hello = ['甲','乙','丙','丁']
#     writeVar('test.pkl',hello)
#     test = readVar('test.pkl')
#     print(test)